<?php
class Index extends Controller
{
	public function main(){
		$demo = $this->M('Demo');
		$this->V('index');
		}
	public function download(){
		$this->V('download');
		}
	public function developer(){
		$this->V('developer');
		}
	public function add(){
		$demo = $this->M('Demo');
		if(isset($_POST["submit"]) || $_POST["submit"] != null){
			$postdata = array(
			'title'=>$_POST["title"],
			'content'=>$_POST["content"],
			'date'=>date("Y-m-d H:i:s"),
			);
		$demo->add($postdata);
			}
		$this->V('add');
		}
	public function lists(){
		$demo = $this->M('Demo');
		$demodata = $demo->Pager(2)->findAll();
		$page = $demo->Pager()->getPager();
		$this->A(array('demodata'=>$demodata,'page'=>$page));
		$this->V('lists');
		}
	public function article(){
		$this->V('article');
		}
	public function help(){
		$this->V('help');
		}
	
}
?>